<html>
<head>
	<title>phpSQLiteAdmin</title>
	<link rel="stylesheet" type="text/css" media="screen" href="<?php echo common::url('include/css/screen.css')?>" />
	<script type="text/javascript" src="include/js/TreeMenu.js"></script>
	<script type="text/javascript" src="include/js/dynContext.js"></script>
	<script type="text/javascript" src="<?php echo common::url('include/js/index.left.php')?>"></script>
	<script type="text/javascript">
	<!--
		function databases_onchange(selectObj)
		{
			var options = selectObj.options[selectObj.selectedIndex].value.split(':');
			var dbName  = selectObj.options[selectObj.selectedIndex].text;
			if (options[0] == '1')
			{
				if (options[1] == '0') alert('Warning! This database is read-only.');
				top.rightFrame.location.href = '<?php echo common::url('database.php')?>&database=' + options[2];
				location.href = '<?php echo common::url('index.left.php')?>&database=' + options[2] + '&name=' + encodeURIComponent(dbName);
			}
			else alert('Cannot find database! Check path and try again.');
			selectObj.selectedIndex = 0;
		}
	// -->
	</script>
</head>
<body class="leftFrame">
<center>
	<p>Database
	<select name="databases" style="width:140px" onchange="databases_onchange(this)">
		<option value="">(Databases) ...</option>
<?php
foreach($databases as $db)
{
?>
		<option value="<?php echo $db['exists']?>:<?php echo $db['writeable']?>:<?php echo rawurlencode($db['path'])?>"><?php echo $db['name']?></option>
<?php
}
?>
	</select>
	</p>
	<hr />
</center>
<?php
$treeMenu->printMenu();
if($CONFIG['authentication']['enabled'])
{
?>
	<p align="center"><a href="<?php echo common::url('logout.php')?>" target="_top">Logout</a></p>
<?php
}
?>
</body>
</html>